import request from '@/utils/request'
// 企业部门列表
export const getDepartments = () => request({
  url: '/company/department'
})
// 删除功能
export const delDepartments = (id) => request({
  url: `/company/department/${id}`,
  method: 'delete'
})
// 新增部门
export const addDepartments = (data) => request({
  url: `/company/department/`,
  method: 'post',
  data
})
// 获取部门详情
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 编辑
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

